<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="Responsive Admin Dashboard Template">
    <meta name="keywords" content="admin,dashboard">
    <meta name="author" content="skcats">
    <!-- The above 6 meta tags *must* come first in the head; any other head content must come *after* these tags -->

    <!-- Title -->
    <title>班级详情</title>

    <!-- Styles -->
    <link href="assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link href="assets/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet">
    <link href="assets/plugins/icomoon/style.css" rel="stylesheet">
    <link href="assets/plugins/uniform/css/default.css" rel="stylesheet"/>

    <link href="assets/plugins/toastr/toastr.min.css" rel="stylesheet">
    <link href="assets/plugins/datatables/css/jquery.datatables.min.css" rel="stylesheet" type="text/css"/>
    <link href="assets/plugins/datatables/css/jquery.datatables_themeroller.css" rel="stylesheet" type="text/css"/>
    <link href="assets/plugins/bootstrap-datepicker/css/datepicker3.css" rel="stylesheet" type="text/css"/>

    <!-- Theme Styles -->
    <link href="assets/css/ecaps.min.css" rel="stylesheet">
    <link href="assets/css/custom.css" rel="stylesheet">


</head>
<body>
<!-- Page Container -->
<div class="page-container">
    <!-- Page Sidebar -->

    <div id="sidebar" class="page-sidebar">
        <div class="page-sidebar-inner">
            <a class="logo-box" href="index.html">
                <span>考试神器</span>
                <i class="icon-radio_button_unchecked" id="fixed-sidebar-toggle-button"></i>
                <i class="icon-close" id="sidebar-toggle-button-close"></i>
            </a>
            <div class="page-sidebar-menu">
                <ul class="accordion-menu">
                    <li id="index">
                        <a href="index.html">
                            <i class="menu-icon icon-home4"></i><span>我的主页</span>
                        </a>
                    </li>
                    <li id="paper">
                        <a href="paper.html">
                            <i class="menu-icon icon-newspaper"></i><span>我的试卷</span>
                        </a>
                    </li>
                    <li id="exam">
                        <a href="exam.html">
                            <i class="menu-icon icon-text_format"></i><span>考试中心</span>
                        </a>
                    </li>
                    <li id="class" class="active-page">
                        <a href="class.html">
                            <i class="menu-icon icon-class"></i><span>我的班级</span>
                        </a>
                    </li>
                    <li id="question">
                        <a href="question.html">
                            <i class="menu-icon icon-inbox"></i><span>我的题目</span>
                        </a>
                    </li>
                </ul>
            </div>
        </div>

    </div>
    <!-- Page Content -->
    <div class="page-content">
        <!-- Page Header -->
        <div id="header" class="page-header">
            <div class="search-form">
                <form action="search.html" method="GET">
                    <div class="input-group">
                        <input type="text" name="search" class="form-control search-input"
                               placeholder="Type something...">
                        <span class="input-group-btn">
				<button class="btn btn-default" id="close-search" type="button"><i class="icon-close"></i></button>
			</span>
                    </div>
                </form>
            </div>
            <nav class="navbar navbar-default">
                <div class="container-fluid">
                    <!-- Brand and toggle get grouped for better mobile display -->
                    <div class="navbar-header">
                        <div class="logo-sm">
                            <a href="javascript:void(0)" id="sidebar-toggle-button"><i class="fa fa-bars"></i></a>
                            <a class="logo-box" href="index.html"><span>考试神器</span></a>
                        </div>
                        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                                data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                            <i class="fa fa-angle-down"></i>
                        </button>
                    </div>

                    <!-- Collect the nav links, forms, and other content for toggling -->

                    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                        <ul class="nav navbar-nav">
                            <li><a href="javascript:void(0)" id="collapsed-sidebar-toggle-button"><i
                                    class="fa fa-bars"></i></a>
                            </li>
                            <li><a href="javascript:void(0)" id="toggle-fullscreen"><i class="fa fa-expand"></i></a>
                            </li>
                            <li><a href="javascript:void(0)" id="search-button"><i class="fa fa-search"></i></a></li>
                        </ul>
                        <ul class="nav navbar-nav navbar-right">
                            <!--                <li><a href="javascript:void(0)" class="right-sidebar-toggle" data-sidebar-id="main-right-sidebar"><i-->
                            <!--                        class="fa fa-envelope"></i></a></li>-->
                            <!--                <li class="dropdown">-->
                            <!--                    <a href="javascript:void(0)" class="dropdown-toggle" data-toggle="dropdown" role="button"-->
                            <!--                       aria-haspopup="true" aria-expanded="false"><i class="fa fa-bell"></i></a>-->
                            <!--                </li>-->
                            <li id="loginname" style="display: inline">
                                <a href="login.html">
                                    <img src="assets/images/head.png" alt="" class="img-circle">
                                    <text><strong>登录</strong></text>

                                </a>
                            </li>
                            <li id="loginli" class="dropdown user-dropdown" style="display: none">
                                <a href="login.html" class="dropdown-toggle" data-toggle="dropdown" role="button"
                                   aria-haspopup="true"
                                   aria-expanded="false">
                                    <img src="assets/images/head.png" alt="" class="img-circle">
                                    <text><strong id="uname">登录</strong></text>
                                </a>

                                <ul class="dropdown-menu">
                                    <!--                        <li><a href="#">个人中心</a></li>-->
                                    <!--                        <li><a href="#">日历</a></li>-->
                                    <!--                        <li><a href="#"><span class="badge pull-right badge-danger">42</span>信息</a></li>-->
                                    <!--                        <li role="separator" class="divider"></li>-->
                                    <li><a href="updpassword.html">修改密码</a></li>
                                    <li><a id="logout" onclick="logout()">退出登录</a></li>
                                </ul>
                            </li>
                        </ul>
                    </div><!-- /.navbar-collapse -->
                </div><!-- /.container-fluid -->
            </nav>

        </div><!-- /Page Header -->
        <!-- Page Inner -->
        <div class="page-inner">
            <div class="page-title">
                <h3 class="breadcrumb-header" id="timename">下午好，HDAWN！</h3>
            </div>
            <div id="main-wrapper">
                <div class="row">
                    <div class="col-md-10">
                        <div class="panel panel-white" id="js-alerts">
                            <div class="panel-heading clearfix">
                                <h2 class="panel-title">
                                    <text id="className">班级名称</text>
                                    <div id="classID" title="学生可通过ID加入班级" class="btn-default"
                                         style="float: right"></div>
                                </h2>
                            </div>
                            <div class="panel-body">
                                <table class="table table-bordered table-striped" style="text-align: center">
                                    <thead>
                                    <tr>
                                        <th>#</th>
                                        <th style="text-align: center">姓名</th>
                                        <th style="text-align: center">类型</th>
                                        <th style="text-align: center">电子邮箱</th>
                                        <th style="text-align: center">操作</th>
                                    </tr>
                                    </thead>
                                    <tbody id="myClass">
                                    <tr>
                                        <th scope="row">1</th>
                                        <td>班级里还没有学生哦~</td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div><!-- Row -->
                <div class="row">
                    <div class="col-md-10">
                        <div class="panel panel-white">
                            <div class="panel-heading clearfix">
                                <h2 class="panel-title">
                                    <div id="classPaper">
                                        <text>班级试卷</text>
                                        <button onclick="showPaperList()" type="button"
                                                class="btn btn-default btn-xs" style="float: right">添加试卷
                                        </button>
                                    </div>
                                </h2>
                            </div>
                            <div class="panel-body">
                                <table class="table table-bordered table-striped" style="text-align: center">
                                    <thead>
                                    <tr>
                                        <th>#</th>
                                        <th style="text-align: center">试卷名称</th>
                                        <th style="text-align: center">题目数量</th>
                                        <th style="text-align: center">创建时间</th>
                                        <th style="text-align: center">创建者</th>
                                        <th style="text-align: center">操作</th>
                                    </tr>
                                    </thead>
                                    <tbody id="myExampaper">
                                    <tr>
                                        <th scope="row">1</th>
                                        <td>班级里还没有考试哦~</td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div><!-- Row -->
                <div class="row" id="paperList" style="display: none">
                    <div class="col-md-10">
                        <div class="panel panel-white">
                            <div class="panel-heading clearfix">
                                <h2 class="panel-title">我的试卷
                                    <div id="divCreatPaper" style="float: right">
                                        <button onclick="selectAll()" type="button"
                                                class="btn btn-default btn-xs">全选
                                        </button>
                                        <button onclick="addExamToClass()" type="button"
                                                class="btn btn-default btn-xs">提交
                                        </button>
                                    </div>
                                </h2>
                            </div>
                            <div class="panel-body">
                                <table class="table table-bordered table-striped" style="text-align: center">
                                    <thead>
                                    <tr>
                                        <th>#</th>
                                        <th style="text-align: center">试卷名</th>
                                        <th style="text-align: center">题目数量</th>
                                        <th style="text-align: center">创建时间</th>
                                        <th style="text-align: center">创建者</th>
                                        <th style="text-align: center">操作</th>
                                        <th style="text-align: center">选择</th>
                                    </tr>
                                    </thead>
                                    <tbody id="mypaper">
                                    <tr>
                                        <th scope="row">1</th>
                                        <td>你还没有创建过试卷哦~</td>
                                    </tr>
                                    </tbody>
                                </table>
                                <div id="tableparent" style='position: absolute;right: 10%'></div>
                            </div>
                        </div>
                    </div>
                </div><!-- Row -->
            </div>
            <div class="page-footer">
                <!-- <p>Copyright &copy; 2018.Company name All rights reserved.<a target="_blank"								href="http://sc.chinaz.com/moban/">&#x7F51;&#x9875;&#x6A21;&#x677F;</a></p> -->
            </div>
        </div><!-- /Page Inner -->
    </div><!-- /Page Content -->
</div><!-- /Page Container -->
<a id="box" type="button" class="btn btn-default btn-xs btn-rounded"
   style="position: fixed;right: 5%;bottom: 50px;cursor: pointer;display: none">返回顶部</a>

<!-- Javascripts -->
<script src="assets/plugins/jquery/jquery-3.1.0.min.js"></script>
<script src="assets/plugins/jquery-cookie/jquery.cookie.js"></script>
<script src="assets/js/load.js"></script>
<script src="assets/plugins/toastr/toastr.min.js"></script>
<script src="assets/plugins/bootstrap/js/bootstrap.min.js"></script>
<script src="assets/plugins/uniform/js/jquery.uniform.standalone.js"></script>
<script src="assets/js/ecaps.min.js"></script>
<script src="assets/plugins/datatables/js/jquery.datatables.min.js"></script>
<script src="assets/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
<script src="assets/plugins/jquery-slimscroll/jquery.slimscroll.min.js"></script>
<script src="assets/js/pages/table-data.js"></script>

<script type="text/javascript">
    $(document).ready(function () {
        var user = getCookie("USER");
        if (user !== null) {
            myclassDetail(getUrlParams("id"));
            myClassExampaper(getUrlParams("id"));
            if (JSON.parse(user).identity === 1) {
                $("#classPaper").html("班级试卷");
            }
        } else {
            window.location.href = "login.html";
        }
    });

</script>
<script type="text/javascript">
    // 窗口加载事件
    window.onload = function () {
        /*
        功能分析：
            1、滚动条滚动到指定位置显示或隐藏返回顶部按钮(事件源：window)
            2、点击返回顶部按钮实现滚动条回到顶部(事件源：box)
        */
        // 给window对象绑定滚动事件
        window.addEventListener('scroll', function () {
            // 获取滚动条距离顶部的位置
            let sTop = document.documentElement.scrollTop ||
                document.body.scrollTop
            // 判断按钮的显示和隐藏
            if (sTop >= 200) {
                box.style.display = 'block'
            } else {
                box.style.display = 'none'
            }
        })
        // 给按钮绑定点击事件
        box.addEventListener('click', function () {
            // 设置定时器动态回到顶部
            let timeId = setInterval(function () {
                // 动态获取滚动条距离顶部的距离
                let sTop = document.documentElement.scrollTop ||
                    document.body.scrollTop
                // 进行值操作
                document.documentElement.scrollTop = sTop - 10
                document.body.scrollTop = sTop - 10
                // 判断滚动条是否回到顶部
                if (sTop <= 0) {
                    clearInterval(timeId)
                }
            }, 10)
        })
    }
</script>
</body>
</html>